home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Controls
/
Visual Basic Controls.iso
/
vbcontrol
/
magict_1
/
simplewe.frm
< prev
next >
Wrap
Text File
|
1999-07-22
|
16KB
|
747 lines
VERSION 5.00
Object = "{3035B5D2-295D-11D3-8C54-006008BA8D16}#1.0#0"; "MAGICTCP.OCX"
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 8010
ClientLeft = 60
ClientTop = 345
ClientWidth = 10080
LinkTopic = "Form1"
ScaleHeight = 8010
ScaleWidth = 10080
StartUpPosition = 3 'Windows-Standard
Begin VB.CheckBox chkSubdirs
Caption = "Enable Subdirectories"
Height = 255
Left = 8040
TabIndex = 25
Top = 240
Width = 1935
End
Begin VB.CommandButton cmdSave
Caption = "Save Config"
Height = 495
Left = 8040
TabIndex = 24
Top = 1200
Width = 1455
End
Begin VB.TextBox txtLog
Height = 2655
Left = 240
MultiLine = -1 'True
ScrollBars = 2 'Vertikal
TabIndex = 22
TabStop = 0 'False
Top = 5280
Width = 9735
End
Begin VB.TextBox txtPhysical
Height = 405
Index = 7
Left = 3960
TabIndex = 21
Top = 4560
Width = 3615
End
Begin VB.TextBox txtVirtual
Height = 405
Index = 7
Left = 240
TabIndex = 20
Top = 4560
Width = 3615
End
Begin VB.TextBox txtPhysical
Height = 405
Index = 6
Left = 3960
TabIndex = 19
Top = 4080
Width = 3615
End
Begin VB.TextBox txtVirtual
Height = 405
Index = 6
Left = 240
TabIndex = 18
Top = 4080
Width = 3615
End
Begin VB.TextBox txtPhysical
Height = 405
Index = 5
Left = 3960
TabIndex = 17
Top = 3600
Width = 3615
End
Begin VB.TextBox txtVirtual
Height = 405
Index = 5
Left = 240
TabIndex = 16
Top = 3600
Width = 3615
End
Begin VB.TextBox txtPhysical
Height = 405
Index = 4
Left = 3960
TabIndex = 15
Top = 3120
Width = 3615
End
Begin VB.TextBox txtVirtual
Height = 405
Index = 4
Left = 240
TabIndex = 14
Top = 3120
Width = 3615
End
Begin VB.TextBox txtPhysical
Height = 405
Index = 3
Left = 3960
TabIndex = 13
Top = 2640
Width = 3615
End
Begin VB.TextBox txtVirtual
Height = 405
Index = 3
Left = 240
TabIndex = 9
Top = 2640
Width = 3615
End
Begin VB.TextBox txtPhysical
Height = 405
Index = 2
Left = 3960
TabIndex = 8
Top = 2160
Width = 3615
End
Begin VB.TextBox txtVirtual
Height = 405
Index = 2
Left = 240
TabIndex = 7
Top = 2160
Width = 3615
End
Begin VB.TextBox txtPhysical
Height = 405
Index = 1
Left = 3960
TabIndex = 6
Top = 1680
Width = 3615
End
Begin VB.TextBox txtVirtual
Height = 405
Index = 1
Left = 240
TabIndex = 5
Top = 1680
Width = 3615
End
Begin VB.TextBox txtPhysical
Height = 405
Index = 0
Left = 3960
TabIndex = 4
ToolTipText = "Corresponding physical path for virtual path to the left"
Top = 1200
Width = 3615
End
Begin VB.TextBox txtVirtual
Height = 405
Index = 0
Left = 240
TabIndex = 3
ToolTipText = "Virtual path"
Top = 1200
Width = 3615
End
Begin VB.CommandButton cmdStart
Caption = "Start!"
Default = -1 'True
Height = 495
Left = 8040
TabIndex = 23
Top = 4440
Width = 1455
End
Begin VB.TextBox txtPort
Height = 375
Left = 600
TabIndex = 0
ToolTipText = "TCP port where to listen"
Top = 240
Width = 855
End
Begin VB.TextBox txtAccessList
Height = 375
Left = 2760
TabIndex = 2
ToolTipText = "Comma separeted list of ip adresses containing wild card '*'"
Top = 240
Width = 4815
End
Begin M3LibCtl.MagicTCP M1
Left = 8400
OleObjectBlob = "SimpleWeb.frx":0000
Top = 2520
End
Begin VB.Line Line2
X1 = 120
X2 = 9960
Y1 = 5160
Y2 = 5160
End
Begin VB.Label Label4
Caption = "Phsical Path"
Height = 255
Left = 3960
TabIndex = 12
Top = 960
Width = 3135
End
Begin VB.Label Label3
Caption = "Virtual Path"
Height = 255
Left = 240
TabIndex = 11
Top = 960
Width = 3135
End
Begin VB.Line Line1
X1 = 120
X2 = 9960
Y1 = 840
Y2 = 840
End
Begin VB.Label Label2
Caption = "Access List"
Height = 375
Left = 1800
TabIndex = 10
Top = 240
Width = 855
End
Begin VB.Label Label1
Caption = "Port"
Height = 255
Left = 240
TabIndex = 1
Top = 240
Width = 375
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Const MAX_VPATHS = 8
Dim ServerSocket As Long
Dim ServerPort As Long
Dim AccessList As String
Dim serverSubdirs As Long
Dim vPath(1 To 8) As String ' our virtual paths
Dim pPath(1 To 8) As String ' corresponding physical paths
Sub CloseSocket()
With M1
If .zzState >= 0 Then
Close .zzState
End If
.Delete .CurrentSocket
End With
End Sub
Sub HttpError(c As Integer, t As String)
' return an http error
Dim s As String
Dim r As String
Dim n As Long
With M1
r = "Error: " & t
s = "HTTP/1.0 " & CStr(c) & " " & t & vbCrLf
s = s & "Content-Type: text/plain" & vbCrLf
s = s & "Content-Length: " & CStr(Len(r)) & vbCrLf
s = s & vbCrLf
s = s & r
n = .WriteString(s)
If (n > 0) And (n < Len(s)) Then
.zzBuffer = Mid$(s, n + 1)
End I